function modalInit() {
  const modal = document.querySelector(".modal");
  const modalDialog = document.querySelector(".modal-dialog");
  const backdrop = document.querySelector(".modal-backdrop");
  const cancelBtn = document.querySelector("button[name='cancel']"),
        cancel = document.querySelector(".cancel");
  const right = document.querySelector("button[name='right']");
  /*setTimeout(()=>{
    modal.className = "modal-dialog animate__animated animate__fadeOutUp";
    backdrop.className = "modal-backdrop animate__animated animate__fadeOut"
  }, 2000)*/
  const cancelFun = ()=> {
    modalDialog.className = 'modal-dialog animate__animated animate__fadeOutUp';
    backdrop.className = 'modal-backdrop animate__animated animate__fadeOut';
    setTimeout(function () {
      backdrop.className = 'hide'
    }, 1000);
    return false;
  }
  cancel.addEventListener('click', ()=>{
    cancelFun();
  });
  cancelBtn.addEventListener('click', ()=>{
    cancelFun();
  });
  backdrop.addEventListener('click', ()=>{
    cancelFun();
  });
  const rightFun = ()=> {
    modalDialog.className = "modal-dialog animate__animated animate__fadeOutUp";
    backdrop.className = "modal-backdrop animate__animated animate__fadeOut"
    setTimeout(function () {
      backdrop.className = 'hide'
    }, 1000);
    return true;
  }
  right.addEventListener('click', () => {
    rightFun();
  });
}

// modal();